package person

import (
	"fmt"
	"time"
)

type Person struct {
	Name     string
	pswd     string
	Birthday time.Time
	Sex      string
	// 钱包
	MoneyPacket float32
}

// 注册
func (p *Person) Register() bool {

	return true
}

// 1. 结构体的方法的编写
// 2. 结构体方法的调用

// 登录
func (p *Person) Login() bool {
	fmt.Println("请输入你的用户名")
	var name string
	fmt.Scanln(&name)
	var pswd string
	fmt.Println("请输入你的密码")
	fmt.Scanln(&pswd)
	if name == "luolaoshi" && pswd == "123456" {
		p.Name = "罗老师"
		p.Sex = "男"
		return true
	}
	if name == "hjj" && pswd == "123456" {
		p.Name = "黄俊杰"
		p.Sex = "男"
		return true
	}

	if name == "hpm" && pswd == "123456" {
		p.Name = "何平敏"
		p.Sex = "女"
		return true
	}
	return false
}

// 吃饭
func (p *Person) Chifan() bool {

	return true
}

// 充值
func (p *Person) Chongzhi(edu float32) {
	p.MoneyPacket = p.MoneyPacket + edu
}
